import request from '@/utils/request';
import type { LoginResponseModel, userInfoResponseModel } from "./model/loginModel"


//创建一个接口路径对象
enum Api {
    Login = '/admin/acl/index/login',
    Logout = '/admin/acl/index/logout',
    GetUserInfo = '/admin/acl/index/info'
}

//接口请求函数(回调函数)
    //登陆
    export const loginApi = (username:string, password:string) =>{
        return request.post <any, LoginResponseModel>(Api.Login,{username,password})
    }

    //退出登陆
    export const logoutApi = () =>{
        return request.post <any,any>(Api.Logout)
    }

    //获取用户信息
    export const getUserInfoApi = () =>{
        return request.get <any,userInfoResponseModel>(Api.GetUserInfo)
    }